<template>
		<view class="userinfo-container">
		  <view class="user-top">
		      <image :src="userInfo.avatarUrl" class="user-avatar"></image>
        <view class="user-name">
         {{ userInfo.nickName }}
        </view>
		  </view>
      <view class="user-panel">
        <view class="panel1">
          <view class="panel-item">
            <view class="panel-info">
              8
            </view>
            <view class="panel-name">
              收藏的店铺
            </view>
          </view>
          <view class="panel-item">
            <view class="panel-info">
              8
            </view>
            <view class="panel-name">
              收藏的商品
            </view>
          </view>
          <view class="panel-item">
            <view class="panel-info">
              8
            </view>
            <view class="panel-name">
              关注的商品
            </view>
          </view>
          <view class="panel-item">
            <view class="panel-info">
              8
            </view>
            <view class="panel-name">
              足迹
            </view>
          </view>
        </view>
        <view class="panel2">
          <view class="panel-title">
            我的订单
          </view>
          <view class="panel-container">
            <view class="panel-item">
              <image src="/static/my-icons/icon1.png" class="panel-img"></image>
              <text>待付款</text>
            </view>
            <view class="panel-item">
             <image src="/static/my-icons/icon2.png" class="panel-img"></image>
              <text>待付款</text>
            </view>
            <view class="panel-item">
              <image src="/static/my-icons/icon3.png" class="panel-img"></image>
              <text>待付款</text>
            </view>
            <view class="panel-item">
              <image src="/static/my-icons/icon4.png" class="panel-img"></image>
              <text>待付款</text>
            </view>
          </view>
          
        </view>
        <view class="panel3">
          <view class="panel-item">
            <view class="panel-l">
              收货地址
            </view>
            <uni-icons type="arrowright" size="20"></uni-icons>
          </view>
          <view class="panel-item">
            <view class="panel-l">
              联系客服
            </view>
            <uni-icons type="arrowright" size="20"></uni-icons>
          </view>
          <view class="panel-item">
            <view class="panel-l">
              退出登录
            </view>
            <uni-icons type="arrowright" size="20"></uni-icons>
          </view>
        </view>
      </view>
    </view>
</template>

<script>
  import { mapState } from 'vuex'
	export default {
		name:"my-userinfo",
		data() {
			return {
				
			};
		},
    computed: {
      ...mapState('user', ['userInfo'])
    }
	}
</script>

<style lang="scss">
.userinfo-container {
  height: 100%;
  background-color: #f4f4f4;
  .user-top {
    height: 400rpx;
    background-color: #c00000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .user-avatar {
      width: 90px;
      height: 90px;
      border: 2px solid #fff;
      border-radius: 50%;
      background-color: black;
      box-shadow: 0 1px 5px black;
    }
    .user-name {
      font-style: 16px;
      color: #fff;
      margin-top: 10px;
    }
  }
  .user-panel {
    padding: 0 10px;
    // background-color: #fff;
    margin-top: -10px;
    .panel1 {
      background-color: #fff;
      border-radius: 5px;
      margin-bottom: 8px;
      display: flex;
      justify-content: space-around;
      font-style: 13px;
      .panel-item {
         display: flex;
         flex-direction: column;
         align-items: center;
         padding: 10px 0;
      }
    }
    .panel2 {
      background-color: #fff;
      margin-bottom: 8px;
      border-radius: 5px;
      .panel-title {
        padding-left: 10px;
        font-style: 14px;
        line-height: 40px;
        border-bottom: 1px solid #eee;
      }
      .panel-container {
        padding: 10px 0;
        display: flex;
        justify-content: space-around;
        .panel-item {
          display: flex;
          flex-direction: column;
          align-items: center;
          .panel-img {
            display: block;
            width: 35px;
            height: 35px;
          }
          text {
            font-style: 12px;
          }
        }
      }
      
    }
    .panel3 {
      background-color: #fff;
      border-radius: 5px;
      .panel-item {
        padding: 10px 10px;
        display: flex;
        justify-content: space-between;
      }
    }
  }

}
</style>
